<template>
    <div class="recommend">
        <div class="title">
            <img class="title-img" src="http://img1.qunarzz.com/piao/fusion/1711/89/ebc329f16c55bb02.png" alt="">
            <span class="title-desc">猜你喜欢</span>
        </div>
        <ul class="item-list">
            <li class="item border-bottom" v-for="item of recommendList" :key="item.id">
                <div class="item-img-wrapper">
                    <img class="item-img" :src="item.imgUrl">
                </div>
                <div class="item-info">
                    <div class="item-title">{{item.title}}</div>
                    <div class="itme-comment">
                        <span  class="item-starlevel">
                            <strong class="item-iconfont iconfont">&#xe664;&#xe664;&#xe664;&#xe664;&#xe664;</strong>
                        </span>
                        <span class="item-num">{{item.num}}条评论</span>
                    </div>
                    <div class="item-address-price">
                        <div class="item-price">
                            <span class="item-price-detail"> ￥
                                <em class="item-priace-num">{{item.price}}</em>
                            </span>
                            起
                        </div>
                        <span class="item-address">{{item.address}}</span>
                    </div>
                </div>
            </li>
        </ul>
    </div>
</template>

<script>
export default {
  name: "HomeRecommend",
  data() {
    return {
      recommendList: [
        {
          id: "01",
          imgUrl:
            "http://img1.qunarzz.com/sight/p0/1507/36/ce3d2d6c9ab44d67ae68d940b8781829.water.jpg_200x200_0938a8f2.jpg",
          title: "北京野生动物园",
          commentNum: "14479",
          price: "72",
          address: "大兴区"
        },
        {
          id: "02",
          imgUrl:
            "http://img1.qunarzz.com/sight/p0/1409/19/adca619faaab0898245dc4ec482b5722.jpg_200x200_1bc99086.jpg",
          title: "故宫",
          commentNum: "312757",
          price: "20",
          address: "东城区"
        },
        {
          id: "03",
          imgUrl:
            "http://img1.qunarzz.com/sight/p0/1508/89/895a1b7add84f23faca053ce9e3153db.water.jpg_200x200_99ae30ee.jpg",
          title: "北京欢乐谷",
          commentNum: "61113",
          price: "49.8",
          address: "朝阳区"
        }
      ]
    };
  }
};
</script>

<style lang="stylus" scoped>
@import '~styles/mixin.styl';

.recommend {
    .title {
        position: relative;
        padding: 0.24rem 0 0.26rem;

        .title-img {
            display: inline-block;
            overflow: hidden;
            width: 0.3rem;
            height: 0.3rem;
            margin-left: 0.2rem;
            vertical-align: top;
        }

        .title-desc {
            display: inline-block;
            margin-left: 0.08rem;
            height: 0.44rem;
            color: #212121;
            font-size: 0.32rem;
            line-height: 0.44rem;
            ellipsis();
        }
    }

    .item-list {
        margin-left: 0.24rem;

        .item {
            position: relative;
            overflow: hidden;
            padding: 0.2rem 0;

            .item-img-wrapper {
                float: left;
                overflow: hidden;
                width: 2rem;
                height: 2rem;

                .item-img {
                    width: 100%;
                }
            }

            .item-info {
                overflow: hidden;
                padding-left: 0.22rem;

                .item-title {
                    margin-top: 0.26rem;
                    height: 0.44rem;
                    color: #212121;
                    font-size: 0.32rem;
                    line-height: 0.44rem;
                    ellipsis();
                }

                .itme-comment {
                    margin-top: 0.14rem;
                    height: 0.34rem;
                    vertical-align: middle;

                    .item-starlevel {
                        display: inline-block;
                        position: relative;
                        width: 1.5rem;
                        height: 0.28rem;
                        line-height: 0.28rem;
                        letter-spacing: 0.02rem;

                        .item-iconfont {
                            font-size: 0.1rem;
                            z-index: 2;
                            color: #ffb436;
                        }
                    }

                    .item-num {
                        color: #616161;
                        font-size: 0.24rem;
                        line-height: 0.34rem;
                    }
                }

                .item-address-price {
                    position: relative;
                    margin-top: 0.22rem;
                    color: #616161;
                    font-size: 0.24rem;
                    line-height: 0.4rem;

                    .item-price-detail {
                        color: #ff8300;

                        .item-priace-num {
                            font-size: 0.4rem;
                        }
                    }

                    .item-address {
                        position: absolute;
                        right: 0.24rem;
                        bottom: 0;
                    }
                }
            }
        }
    }
}
</style>

